import Draw from "./draw/index.js"
let tank = new Draw("canvas");
let tank2 = new Draw("canvas");
// let tank = canvas.tank();
// a.init()


document.querySelector("body").onkeydown = function (e) {
    console.log(e.key)
    switch (e.key) {
        case "ArrowLeft":
            tank.commit(0);
            break;
        case "ArrowUp":
            tank.commit(2);
            break;
        case "ArrowRight":
            tank.commit(1);
            break;
        case "ArrowDown":
            tank.commit(3);
            break;
        case " ":
        // console.log(22)
        tank.shoot();
        break;
        case "a":
            tank2.commit(0);
            break;
        case "w":
            tank2.commit(2);
            break;
        case "d":
            tank2.commit(1);
            break;
        case "s":
            tank2.commit(3);
            break;
        case "x":
            // console.log(22)
            tank2.shoot();
            break;
        default:
            break;
    }
}